IF exists(SELECT * FROM dbo.sysobjects WHERE name='Fl_vulKlaslokalen' AND xtype='P') 
BEGIN
	DROP PROCEDURE Fl_vulKlaslokalen
END
GO

CREATE  procedure Fl_vulKlaslokalen
as

insert into Fl_klaslokalen(klas)
select distinct deklas from leraars..rooster as r
   left join  Fl_klaslokalen  as k
   on k.klas = r.deKlas
   where left(r.deKlas,1) = '6' and k.klas is null


insert into fl_vakdagen(vak)
select distinct hetVak from leraars..rooster as r
   left join  Fl_vakDagen  as k
   on k.vak = r.hetVak
   where left(r.deKlas,1) = '6' and k.vak is null